<?php
declare (strict_types = 1);

namespace app\api\controller\Card;

use app\BaseController;
use app\common\model\Card\Order as OrderModel;
use app\common\model\User\User as UserModel;
use think\Request;

class Order extends BaseController
{
    
    public function index()
    {
        $userid=$this->request->param('userid');
        $User = UserModel::find($userid);
        if (!$User) {
            $this->error('用户不存在');
        }
        $OrderList=OrderModel::where(['userid'=>$userid])->select();
        if ($OrderList===FALSE) {
            $this->error('查询订单失败');
        }
        $this->success('查询成功',null,$OrderList);
    }
}
